﻿namespace BusinessLogic.Mappers.User.Mapping
{
	internal class UserMapping : IMapping<BusinessEntity.Entities.User, DataControl.User>
	{
		public BusinessEntity.Entities.User ToBE(DataControl.User from)
		{
			var to = new BusinessEntity.Entities.User();

			to.Email = from.Email;
			to.Fax = from.Fax;
			to.ID = from.ID;
			to.MiddleName = from.MiddleName;
			to.Name = from.Name;
			to.Phone = from.Phone;
			to.Surname = from.Surname;
			to.PublicKey = from.PublicKey;
			to.Login = from.Login;
			to.Password = from.Password;

			return to;
		}

		public DataControl.User ToDTO(BusinessEntity.Entities.User from)
		{
			var to = new DataControl.User();

			to.Email = from.Email;
			to.Fax = from.Fax;
			to.ID = from.ID;
			to.MiddleName = from.MiddleName;
			to.Name = from.Name;
			to.Phone = from.Phone;
			to.Surname = from.Surname;
			to.Password = from.Password;
			to.Login = from.Login;
			to.PublicKey = from.PublicKey;

			return to;
		}
	}
}